[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449
[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Conversation
3a663ea to
e113bc8
Compare
e113bc8 to
0b671c9
Compare
daaria-s
left a comment
There was a problem hiding this comment.
Thank you for the updates! LGTM
0b671c9 to
93a1e86
Compare
There was a problem hiding this comment.
It's not entirely true: blendingEnabled can be true even without compose.interop.blending. Having a transparent Panel.background is enough.
(And I'm not sure that dialog panels cannot have a custom background, different from Panel.background, but it's out of scope for this PR anyway)
There was a problem hiding this comment.
Removed (via compose.interop.blending) part, thanks!
There was a problem hiding this comment.
WDYT about mentioning compose.interop.blending and transparent panel here? They also affect whether windowShape gets invoked
There was a problem hiding this comment.
Yeah, I agree. windowShape is not just limited by our custom flag, but it fails silently if the panel background is transparent. Updated the KDoc. Thanks!
add missing jbpopuprenderer to commits
93a1e86 to
0f31bf3
Compare
Context
During the development of the Got It component, we ran into a limitation of our current
JDialogRenderer. Currently, it can only render windows with rounded corners. While this works perfectly for menus and other types of popups, it fails to provide the best UX for the Got It component since it has a custom shape.So, this PR paves the way so that our Got It component can be rendered in all its glory!
Changes
Popupthat takewindowShape: ((IntSize) -> java.awt.Shape)? = null,. Deprecated variations without it.windowShape: ((IntSize) -> java.awt.Shape)? = null,lambda parameter toPopupRendererand passed it down to bothJDialogRendererandJBPopupRendererJDialogRenderercode to apply the custom window shape defined by the factory lambda if:compose.interop.blendingis disabledwindowShapeis not nullDemo
Screen.Recording.2026-03-05.at.16.08.49.mov
Closeup of Jagged Arrow Shape
Note
Keep in mind this only ever happens if users provide a custom shape via the new factory parameter AND don't enable
compose.interop.blending!Curiously, this minor artifact is not present when the arrow is to the right. No idea why, though.
Release notes
New features
Popupis available which take awindowShapefactory. With this, you can create a custom shape that'll be applied to the window which holds the popup. Bear in mind that this factory is only useful in the following scenario:jewel.customPopupRenderflag enabledcompose.interop.blendingenabledWindowTranslucencycan't render concave corners properly since it forces pixels to be either completely off or on. This means that depending on your custom shape, you can have jagged edges. For this reason, it's highly encouraged to also enablecompose.interop.blendingin your system properties.Deprecated API
Popupcomponents without thewindowShapeparameter are now deprecated.